package com.yayohos.locationmanager.configuration;

/**
 * Defaults
 *
 * @date 2021/5/26
 */
public final class Defaults {
    static final String EMPTY_STRING = "";
    static final int LOCATION_DISTANCE_INTERVAL = 0;
    static final float MIN_ACCURACY = 10.0f;
    static final boolean KEEP_TRACKING = false;
    static final boolean FALLBACK_TO_DEFAULT = true;
    static final boolean ASK_FOR_GP_SERVICES = false;
    static final boolean ASK_FOR_SETTINGS_API = true;
    static final boolean FAIL_ON_SETTINGS_API_SUSPENDED = false;
    static final boolean IGNORE_LAST_KNOW_LOCATION = false;
    static final int SECOND = 1000;
    static final int MINUTE = 60 * SECOND;
    static final int WAIT_PERIOD = 5 * SECOND;
    static final int TIME_PERIOD = 5 * MINUTE;
    static final int LOCATION_INTERVAL = 5 * MINUTE;
    static final int LOCATION_FASTEST_INTERVAL = MINUTE;
    static String[] locationPermissions;
    private Defaults() {
        // No instance
    }

    /**
     * 设置定位的权限
     *
     * @param locationPermissions 待申请的权限
     */
    public static void setLocationPermissions(String[] locationPermissions) {
        Defaults.locationPermissions = locationPermissions.clone();
    }

    /**
     * 获取定位的权限
     *
     * @return String[] 权限数组
     */
    public static String[] getLocationPermissions() {
        if (locationPermissions != null && locationPermissions.length > 0) {
            return locationPermissions.clone();
        } else {
            return new String[]{"ohos.permission.LOCATION"};
        }
    }

}